const {userLogin,userImg,updateImg,newRegis,userInfo,userAllInfo}=require('../db/Data/userData.js');

module.exports.userLogin =async function (Info) {
  let data=await userLogin(Info);
  if(data._id){
    return {
      message:'登陆成功',
      status: '200',
      data: data
    }
  }else{
    return {
      message:'用户不存在或者密码错误',
      status: '0'
    }
  }
}

module.exports.userImg =async function(Info){
  let data =await userImg(Info);
  if(data._id){
    return data;
  }
}

module.exports.updateImg=async function(Info){
  let data =await updateImg(Info);
}

module.exports.newRegis=async function(Info){
  let data =await newRegis(Info);
  if(data._id){
    return {
      message:'成功注册',
      status: '200'
    }
  }else{
    return {
      message:'注册失败',
      status: '0'
    }
  }
}

module.exports.userInfo =async function(Info){
  let data =await userInfo(Info);
  if(data._id){
    return data;
  }
}

module.exports.userAllInfo=async function(){
  let data =await userAllInfo();
  if(data){
    return data;
  }
}